# a = 1
# b = 2
# c = a + b
# print(c)

# 函数名是一个特殊的变量。
# def func():
#     print(666)
#
# print(func)  # func = <function func at 0x00000000003F1EA0>
# 1,函数名指向的是函数的内存地址,加上()就执行这个函数。
# func()

# 2函数名是一个变量。
# age1 = 12
# age2 = age1
# age3 = age2
# print(age3)
# def func():
#     print(666)
#
# f1 = func
# f2 = f1
# f2()
# f1()

# 3. 函数名可以作为容器类类型的元素。
# a = 1
# b = 2
# c = 3
# l = [a,b,c]
# print(l)

# def func1():
#     print('in func1')
#
# def func2():
#     print('in func2')
#
# def func3():
#     print('in func3')
#
# l = [func1, func2, func3]
# # print(l)
# for i in l:
#     i()

# 4. 函数名可以作为函数的实参。

# a = 1
# def func(argv):
#     print(argv)
# func(a)

# def func1():
#     print('in func1')
#
# def func2(argv):
#     argv()
#     print('in func2')
#
# func2(func1)

# 5. 函数名可以作为函数的返回值。

# b = 666
#
# def func1():
#     print('in func1')
#
# def func2(argv):
#     print('in func2')
#     return argv
# ret = func2(b)
# print(ret)



# def func1():
#     print('in func1')
#
# def func2(argv):
#     # argv = func1 : function 43543
#     print('in func2')
#     return argv
# ret = func2(func1)  # func1 : function 43543
# ret()

# def wrapper():
#
#     def inner():
#         print(666)
#     return inner
# # ret = wrapper()
# # ret()
# wrapper()()